<script setup lang="ts">
import router from "@/router";
import NewInfo from "@/views/NewInfo.vue";
import { onMounted, watch } from "vue";
import { RouterLink, RouterView } from 'vue-router'


// 已进入此页，强制刷新一次
onMounted(() => {
    if (location.href.indexOf("#reloaded") <= 0) {
        location.href = location.href + "#reloaded" + "#reloaded";
        location.reload();
    }
})

</script>

<template>
    <div id="header">
        <div>
            <router-link class="bi bi-chevron-left" to="/"></router-link>
        </div>
        <div>朋友圈</div>
        <div>
            <router-link class="bi bi-camera" to="/add"></router-link>
        </div>
    </div>
    <div class="bgp">
        <img src="@/assets/bg.jpg" alt="">
    </div>
    <div class="main">
        <div class="info">
            <span>Elon Reeve Musk</span>
            <img src="@/assets/header.png" alt="">
        </div>
        <NewInfo />
    </div>
</template>

<style scoped lang="scss">
#header {
    width: 100%;
    height: 50px;
    background-color: #f0f0f0;
    font-size: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    //搜索栏浮动
    position: fixed;
    top: 0px;
    z-index: 999;
}

.bgp {
    width: 100vw;
    height: 40vh;

    img {
        width: 100%;
        height: 100%;
    }
}


.main {
    width: 100%;
    height: 700px;
    position: relative;
    // background-color: rgb(227, 27, 27);
    padding: 15px;

    .info {
        position: absolute;
        right: 20px;
        top: -40px;
        width: 65px;
        height: 65px;

        span {
            width: 150px;
            position: absolute;
            right: 12vw;
            top: 12px;
            color: #fff;
            font-size: 15px;
        }

        img {
            width: 100%;
            height: 100%;
            background-color: #fff;
            border-radius: 10px;
        }
    }
}

a {
    color: #a4a4a4;
}
</style>
